<!-- inc:head -->

<div class="notice">
&raquo; 添加图片信息
<input type="button" value="图片信息列表" onclick="tourl('admin.php?file=picture&act=list')">
</div>

<div style="height:2px;"><div></div></div>

<div class="none">
<form method="post" action="admin.php?file=picture&act=addok" onsubmit="return chk();">
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">主题：<span style="color:red;">*</span></div>
	<div class="right">
		<input type="text" name="subject" id="subject" class="long_input">
		<img src="images/style.gif" title="主题样式" style="cursor:pointer;" align="absmiddle" onclick="subject_css(this)">
		<span class="clue_on">[请填写名称]</span>
	</div>
	<div class="clear"></div>
</div>

<input type="hidden" name="style" id="style">

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">分类：<span style="color:red;">*</span></div>
	<div class="right">
		<select name="cateid" id="cateid">
		<option value="0">请选择一个分类</option>
		<!-- $catelist AS $key=>$value -->
		<option value="{:$value[id]}">{:$value[space]}{:$value[catename]}</option>
		<!-- end -->
		</select>
	</div>
	<div class="clear"></div>
</div>


<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">审核：</div>
	<div class="right">
		<input type="checkbox" name="ifcheck" id="ifcheck" checked> <span class="clue_on">[未审核请将打勾去掉，反之请打上勾]</span>
	</div>
	<div class="clear"></div>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">属性：</div>
	<div class="right">
		<input type="checkbox" name="istop" id="istop" value="1"> 置顶 
		<input type="checkbox" name="isvouch" id="isvouch" value="1"> 推荐 
		<input type="checkbox" name="isbest" id="isbest" value="1"> 精华 
		&nbsp;自定义模板：
		<input type="text" name="tplfile" id="tplfile">
		<span class="clue_on">[不清楚请留空]</span>
	</div>
	<div class="clear"></div>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">排序：</div>
	<div class="right">
		<input type="text" name="taxis" id="taxis" class="short_input" value="0">
		<span class="clue_on">[值越大越往前靠]</span>
		&nbsp; 点击率：
		<input type="text" name="hits" id="hits" class="short_input" value="0">
	</div>
	<div class="clear"></div>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">发布人/时间：<span style="color:red;">*</span></div>
	<div class="right">
		<input type="text" name="author" id="author" value="{:$_SESSION[admin][user]}">
		&nbsp; 发布时间：
		<input type="text" name="postdate" id="postdate" onclick="ShowDate('postdate');">
	</div>
	<div class="clear"></div>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">缩略图：<span style="color:red;">*</span></div>
	<div class="right">
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td><input type="text" name="thumb" id="thumb" class="long_input" readonly></td>
			<td>&nbsp;</td>
			<td><input type="button" value="添加" onclick="add_thumb()"></td>
			<td>&nbsp;</td>
			<td><input type="button" value="删除" onclick="clear_thumb()"></td>
		</tr>
		</table>
	</div>
	<div class="clear"></div>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">大图：</div>
	<div class="right">
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td><input type="text" name="mark" id="mark" class="long_input" readonly></td>
			<td>&nbsp;</td>
			<td><input type="button" value="添加" onclick="add_mark()"></td>
			<td>&nbsp;</td>
			<td><input type="button" value="删除" onclick="clear_mark()"></td>
		</tr>
		</table>
	</div>
	<div class="clear"></div>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<div class="left">链接网址：</div>
	<div class="right">
		<input type="text" name="picture_url" id="picture_url" class="long_input">
		<span class="clue_on">[使用链接网址后内容无效，外链均在新窗口打开]</span>
	</div>
	<div class="clear"></div>
</div>

<div class="table">
	<div class="left">内容：</div>
	<div class="right">{inc:fckeditor}</div>
	<div class="clear"></div>
</div>

<br /><br />
<div class="table">
	<div class="left"></div>
	<div class="right"><input type="submit" id="picture_submit" name="picture_submit" value="添 加"></div>
	<div class="clear"></div>
</div>

</form>

<script type="text/javascript">
function subject_css(v)
{
	var vLeft = getLeft(v);
	var vTop = getTop(v);
	Layer.init('admin.php?file=open&act=style&inputname=style&subject_input=subject',375,170,vLeft,vTop);
}
function chk()
{
	var subject = $("subject").value;
	if(!subject)
	{
		alert("名称不能为空");
		return false;
	}
	var oEditor = FCKeditorAPI.GetInstance('content');
	var content = oEditor.GetXHTML(true);
	var url = $("picture_url").value;
	if(!url && !content)
	{
		alert("链接和内容必须有一个不为空");
		return false;
	}
	var cateid = $("cateid").value;
	if(!cateid || cateid == "0")
	{
		alert("请选择一个分类");
		return false;
	}
	var thumb = $("thumb").value;
	if(!thumb)
	{
		alert("缩略图不允许为空");
		return false;
	}
	$("picture_submit").disabled = true;
}
function clear_thumb()
{
	$("thumb").value = "";
}
function add_thumb()
{
	var url = "admin.php?file=open&act=thumb&input_name=thumb";
	Layer.init(url,600,420);
}

function clear_mark()
{
	$("mark").value = "";
}
function add_mark()
{
	var url = "admin.php?file=open&act=mark&input_name=mark";
	Layer.init(url,600,420);
}
</script>
<!-- inc:foot -->